package cn.txzhang.bookstores.config.web;

import cn.stylefeng.roses.kernel.db.starter.GunsMyBatisPlusAutoConfiguration;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * mybatis-plus 配置类
 */
@Configuration
public class MybatisPlusConfig {

    @Bean
    public GunsMyBatisPlusAutoConfiguration gunsMyBatisPlusAutoConfiguration() {
        GunsMyBatisPlusAutoConfiguration gunsMyBatisPlusAutoConfiguration = new GunsMyBatisPlusAutoConfiguration();
        gunsMyBatisPlusAutoConfiguration.mybatisPlusInterceptor().addInnerInterceptor(new OptimisticLockerInnerInterceptor());
        return gunsMyBatisPlusAutoConfiguration;
    }

}

